//
//  ST_PecSquareHeaderViewChildCellModel.swift
//  btvideo
//
//  Created by mac on 2020/6/4.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import Foundation
import SwiftyJSON


class ST_PecSquareHeaderViewChildCellModel : NSObject{

    var coverImg : String!
    var descriptionField : String!
    var id : Int!
    var image : String!
    var intro : String!
    var likeNum : Int!
    var name : String!
    var ownNum : Int!
    var remark : String!
    var title : String!
    var type : Int!

    
    
    var remarkAttri = NSAttributedString()
    /**
     * Instantiate the instance using the passed json values to set the properties values
     */
    init(fromJson json: JSON!){
        
        super.init()
        if json.isEmpty{
            return
        }
        coverImg = json["cover_img"].stringValue
        descriptionField = json["description"].stringValue
        id = json["id"].intValue
        image = json["image"].stringValue
        intro = json["intro"].stringValue
        title = json["title"].stringValue
        likeNum = json["like_num"].intValue
        name = json["name"].stringValue
        ownNum = json["own_num"].intValue
        remark = json["remark"].stringValue
        type = json["type"].intValue
        
        
        
        let attrString = NSMutableAttributedString(string: json["remark"].stringValue)
        
        let par = NSMutableParagraphStyle()
        
        par.lineSpacing = 3
        
        let attr: [NSAttributedString.Key : Any] = [.font: UIFont.systemFont(ofSize: 14),.foregroundColor: UIColor(red: 1, green: 1, blue: 1, alpha: 1),.paragraphStyle:par]
        
        attrString.addAttributes(attr, range: NSRange(location: 0, length: attrString.length))
        
        self.remarkAttri = attrString
    }
}
